/*    */ package com.zimbra.cs.imap;
/*    */ 
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.StringUtil;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class FetchCommand
/*    */   extends ImapCommand
/*    */ {
/*    */   private String sequence;
/*    */   private int attributes;
/*    */   private List<ImapPartSpecifier> parts;
/*    */   private List<ImapPartSpecifier> originalParts;
/*    */   
/*    */   public FetchCommand(String sequence, int attributes, List<ImapPartSpecifier> parts)
/*    */   {
/* 35 */     this.sequence = sequence;
/* 36 */     this.attributes = attributes;
/* 37 */     this.parts = parts;
/* 38 */     this.originalParts = (parts == null ? null : new ArrayList(parts));
/*    */   }
/*    */   
/*    */   public boolean equals(Object obj)
/*    */   {
/* 43 */     FetchCommand fetch = (FetchCommand)obj;
/* 44 */     if (super.equals(obj))
/* 45 */       return true;
/* 46 */     if ((this.attributes == fetch.attributes) && (StringUtil.equal(this.sequence, fetch.sequence)))
/*    */     {
/*    */ 
/* 49 */       if (this.originalParts == null)
/* 50 */         return fetch.originalParts == null;
/* 51 */       if ((fetch.originalParts == null) || (fetch.originalParts.size() != this.originalParts.size())) {
/* 52 */         return false;
/*    */       }
/* 54 */       return this.originalParts.containsAll(fetch.originalParts);
/*    */     }
/*    */     
/* 57 */     return false;
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/*    */   protected boolean throttle(ImapCommand lastCommand)
/*    */   {
/* 65 */     if (((this.attributes & 0x7) == 0) && (this.parts != null) && (this.parts.size() == 1) && 
/* 66 */       (((ImapPartSpecifier)this.parts.get(0)).isIgnoredExchangeHeader())) {
/* 67 */       ZimbraLog.imap.warn("possible misconfigured client; requested ignored header in part %s", new Object[] { this.parts.get(0) });
/* 68 */       this.parts.clear();
/*    */     }
/*    */     
/* 71 */     return false;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/imap/FetchCommand.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */